SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

ALTER  trigger [tb_comcheckaccept_bd] on dbo.tb_comcheckaccept instead of delete
as

begin
  set nocount on
  delete from tb_comcheckacceptbatch where exists(select 1 from deleted where tb_comcheckacceptbatch.bid = deleted.bid)
  delete from tb_comcheckacceptraw where exists(select 1 from deleted where tb_comcheckacceptraw.bid = deleted.bid)
  delete from tb_comcheckacceptdtl where exists(select 1 from deleted where tb_comcheckacceptdtl.bid = deleted.bid)
  delete from tb_comcheckaccept where exists(select 1 from deleted where tb_comcheckaccept.bid = deleted.bid)
end

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

